package dao;

import pojo.FindWorkerParam;
import pojo.Worker;

import java.util.List;

public interface WorkerDao {

    /**
     * 员工登录方法
     * @param workerLoginName 员工登录名
     * @param workerPassword  员工密码
     * @return
     */
    public Worker login(String workerLoginName, String workerPassword);


    /**
     * 通过登录名查找用户
     * @param workerLoginName 员工登录名
     * @return
     */
    public Worker findWorkerByName(String workerLoginName);

    /**
     * 查询员工的所有信息
     * @param workerLoginName
     * @return
     */
    public Worker workerDetail(String workerLoginName);

    /**
     * 添加员工
     * @param worker
     * @return
     */
    public Integer add(Worker worker);

    /**
     * 查找是否有相同的登录名
     * @param loginName
     * @return
     */
    public Boolean findByLoginName(String loginName);

    /**
     * 根据条件查找用户
     * @param findWorkerParam
     * @return
     */
    public List<Worker> findWorkByParam (FindWorkerParam findWorkerParam);

    /**
     * 根据条件查找员工的个数
     * @param findWorkerParam
     * @return
     */
    public Integer countFindWorkByParam(FindWorkerParam findWorkerParam);

    /**
     * 通过ID查找员工
     * @param workerId
     * @return
     */
    public Worker findWorkerById(String workerId);

    /**
     * 修改员工密码
     * @param workerId
     * @return
     */
    public Integer updateWorkerPassword(String workerId, String password);

    /**
     * 根据员工电话号码修改密码
     * @param workerPhone
     * @param resetPassword
     * @return
     */
    public Integer updateWorkerPasswordByWorkerPhone(String workerPhone,String resetPassword);

    /**
     * 根据员工登录名增加员工登录错误次数
     * @param workerLoginName
     * @return
     */
    public Integer addWorekErrorloginTimesByWorkerLoginName(String workerLoginName);

    /**
     * 根据员工登录名重置员工登录错误次数
     * @param workerLoginName
     * @return
     */
    public Integer resetWorekErrorloginTimesByWorkerLoginName(String workerLoginName);


    /**
     * 根据员工登录名获取登录错误次数
     * @param workerLoginName
     * @return
     */
    public Integer findLoginerrorTimesByWorkerLoginName(String workerLoginName);

    /**
     * 根据手机号判断是否有员工
     * @param workerPhone
     * @return
     */
    public Boolean checkPhoneExist(String workerPhone);
}
